﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace ReactReduxTool.Utils
{
    public class FileUtil
    {

        /// <summary>
        /// 获取文件内容
        /// </summary>
        /// <param name="filename"></param>
        /// <returns></returns>
        public static string File2String(string filename)
        {
            byte[] contentBytes = File.ReadAllBytes(filename);
            return Encoding.UTF8.GetString(contentBytes);
        }

        /// <summary>
        /// 获取文件字节内容
        /// </summary>
        /// <param name="filename"></param>
        /// <returns></returns>
        public static byte[] File2ByteArray(string filename)
        {
            return File.ReadAllBytes(filename);
        }

    }
}
